﻿using System;

namespace Ndns.Packet.Abstractions.ResourceRecords
{
    public sealed class DnsResourceRecordANY : DnsResourceRecord
    {
        public override DnsHostName HostName { get; set; }
        public override DnsRecordType Type { get => DnsRecordType.ANY; protected set => throw new NotSupportedException(); }
        public override DnsClass Class { get; protected set; }
        public byte[] Data { get; set; }

        public DnsResourceRecordANY(DnsHostName hostName, DnsClass c, uint ttl)
            : base(hostName, c, ttl)
        {
        }
        public DnsResourceRecordANY(DnsHostName hostName, DnsClass c, uint ttl, byte[] data)
            : base(hostName, c, ttl)
        {
            Data = data ?? throw new ArgumentNullException(nameof(data));
        }

        public override DnsResourceRecord Clone()
        {
            return new DnsResourceRecordANY(HostName, Class, TTL, Data);
        }
        
    }
}
